Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mjml-section

Package Overview
Dependencies
Maintainers
6
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-section

mjml-section

  • 4.15.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
531K
decreased by-13.62%
Maintainers
6
Weekly downloads
 
Created
Source

mj-section

Sections are intended to be used as rows within your email. They will be used to structure the layout.

<mjml>
  <mj-body>
    <mj-section full-width="full-width" background-color="red">
      <!-- Your columns go here -->
    </mj-section>
  </mj-body>
</mjml>

try it live

The full-width property will be used to manage the background width. By default, it will be 600px. With the full-width property on, it will be changed to 100%.

Inverting the order in which columns display: set the `direction` attribute to `rtl` to change the order in which columns display on desktop. Because MJML is mobile-first, structure the columns in the order you want them to stack on mobile, and use `direction` to change the order they display on desktop. Sections cannot nest in sections. Columns can nest in sections; all content must be in a column.
attributeunitdescriptiondefault value
background-colorcolorsection colorn/a
background-positionpercent / 'left','top',... (2 values max)css background position (see outlook limitations below)top center
background-position-xpercent / keywordcss background position xnone
background-position-ypercent / keywordcss background position ynone
background-repeatstringcss background repeatrepeat
background-sizepx/percent/'cover'/'contain'css background sizeauto
background-urlurlbackground urln/a
borderstringcss border formatnone
border-bottomstringcss border formatn/a
border-leftstringcss border formatn/a
border-radiuspxborder radiusn/a
border-rightstringcss border formatn/a
border-topstringcss border formatn/a
css-classstringclass name, added to the root HTML element createdn/a
directionltr / rtlset the display order of direct childrenltr
full-widthstringmake the section full-widthn/a
paddingpxsupports up to 4 parameters20px 0
padding-bottompxsection bottom offsetn/a
padding-leftpxsection left offsetn/a
padding-rightpxsection right offsetn/a
padding-toppxsection top offsetn/a
text-alignstringcss text-aligncenter
Limitations of background-images size and position on Outlook desktop : - If background-size is not specified, no-repeat will be ignored on Outlook. - If the specified size is a single attribute in percent, the height will be auto as in standard css. On outlook, the image will never overflow the element, and it will be shrinked instead of being cropped like on other clients.

FAQs

Package last updated on 05 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc